<template>
  <table>
    <tr>
      <td>账号</td>
      <td>
      <input type="text" id="username" placeholder="请输入账号" v-model="List.username" />
      </td>
    </tr>
    <tr>
      <td>密码</td>
      <td>
      <input type="password" id="password" placeholder="请输入密码" v-model="List.password" />
      </td>
    </tr>
    <tr>
      <td></td>
      <td>
      <input type="button" value="登录" @click="handleLogin">
      </td>
    </tr>
  </table>
</template>

<script setup lang="ts">
import { ref } from 'vue';
const List = ref({
  username: '',
  password: '',
});
const handleLogin = () => {
  console.log(List.value);
  alert('用户名：' + List.value.username + '，密码：' +List.value.password);
};
</script>





